﻿@{
    ViewBag.Title = "YzPage";
    Layout = null;
}
<html>
<head>
    <script src="~/Scripts/EasyUI/jquery.min.js"></script>
    <script src="~/Scripts/EasyUI/jquery.easyui.min.js"></script>
    <link href="~/Scripts/EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="~/Scripts/EasyUI/themes/default/easyui.css" rel="stylesheet" />

    <script type="text/javascript">
        $(function () {
            initEvent();
        });

        function initEvent() {
            $("#btnYz").click(function () {
                var yzm = $("#yzm").val();
                if ($.trim(yzm) == "") {
                    alert("请输入验证码！");
                    return;
                }
                $.ajax({
                    url: '@Url.Action("DoYZ", "Active917")',
                    data: { yzm: yzm },
                    type: 'post',
                    dataType: 'json',
                    success: function (data) {
                        if (data.isHave == "1") {
                            $("#result").css("color", "green").text("验证通过！");
                            var objData = data.list[0];
                            if (objData != null) {
                                $("#xm").val(objData.Name);
                                $("#ms").val(objData.Remark);
                                $("#lx").val(objData.UserTYpe);
                                if (objData.UserTYpe = "嘉宾") {
                                    $("#ewm").prop("src", "@Url.Content("~/Static/Image/jbewm.jpg")");
                                    } else {
                                        $("#ewm").prop("src", "@Url.Content("~/Static/Image/mtewm.jpg")");
                                    }
                                }
                            } else {
                                reset1();
                                $("#result").css("color", "red").text("验证失败！");
                            }
                        }
                });
            });
            }

            function reset1() {
                $("#xm").val("");
                $("#ms").val("");
                $("#lx").val("");
            }
    </script>
    <style type="text/css">
        .txtClass {
            width: 200px;
            line-height: 20px;
            height: 25px;
            border-radius: 5px;
            border: 1px solid #09b8e8;
            font-size: 20px;
        }



        .ff td {
            height: 25px;
        }
    </style>
</head>
<body style="width: 100%; font-family: FZYaoTi; background-color: #0094ff">
    <div style="margin: 100px auto 0 auto; width: 500px">
        <div class="easyui-panel" title="嘉宾入场验证" style="width: 500px; margin: auto">
            <div style="padding: 10px 60px 20px 60px">
                <form id="ff" class="easyui-form" method="post" data-options="novalidate:true">
                    <table cellpadding="5">
                        <tr>
                            <td>验证码:</td>
                            <td>
                                <input type="text" class="txtClass" id="yzm" />
                            </td>
                            <td><a href="javascript:void(0)" class="easyui-linkbutton" id="btnYz">&nbsp;&nbsp;&nbsp;&nbsp;验证&nbsp;&nbsp;&nbsp;&nbsp;</a></td>
                        </tr>

                        <tr>
                            <td>姓名：</td>
                            <td>
                                <input type="text" class="txtClass" id="xm" /></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>描述：</td>
                            <td>
                                <input type="text" class="txtClass" id="ms" /></td>
                            <td></td>
                        </tr>

                        <tr>
                            <td>类型：</td>
                            <td>
                                <input type="text" class="txtClass" id="lx" /></td>
                            <td></td>
                        </tr>

                        <tr>
                            <td>二维码：</td>
                            <td>
                                <img src="~/Static/Image/cxgbd.jpg" width="150" height="130" id="ewm" />
                            </td>
                            <td></td>
                        </tr>

                        <tr>
                            <td>验证结果：</td>
                            <td>
                                <h2 id="result"></h2>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
